	<div class="page-header users-header">
	  <h2>
		SEO Queue
	  </h2>
	</div>	
	<?php
		if(isset($error))
			echo '<p>'.$error.'</p>';
		$fb_nick = array('name'=>'fb_nick','value'=>isset($fb_nick)?$fb_nick:set_value('fb_nick'),'class'=>'form-control');
		$status = array('-1'=>'Tất cả','C'=>'Chưa xử lý','D'=>'Đang xử lý','X'=>'Xong');
	?>
	<div class="row">
		<div class="span12 columns">
			<?php echo form_open_multipart('admin/facebook/upload', array('class'=>"form-inline", 'role'=>"form",'style'=>"margin-bottom:0;overflow:hidden;"));?>
				<label>Nick facebook:</label>
				<?=form_input($fb_nick)?>
				<label>Html file:</label>
				<input type="file" name="userfile" size="20" />				
				<input type="submit" class="btn btn-default" value="Upload" />
			</form>
			<br/>
			<?php if(isset($error)) exit;?>
			<div class="well">
				<form style="margin-bottom:0;overflow:hidden;" class="form-inline" role="form" action="<?=base_url('admin/facebook')?>" method="post">
					<div class="span3">
						<label>Nick facebook:</label>
						<?=form_input($fb_nick)?>
					</div>
					<div class="span3">
						<label>Trạng thái:</label>
						<?=form_dropdown('trang_thai',$status, isset($trang_thai)?$trang_thai:set_value('trang_thai'),'')?>
					</div>
					<div class="span2">
						<label>&nbsp;</label><br/>
						<input type="submit" class="btn btn-default form-control" value="Lọc"/>
					</div>
				</form>
			</div>
			<form method="post" action="<?=base_url('admin/duyethosocanhan/update')?>">
				<div style="margin-bottom:10px;">
					<?php if($updated = $this->session->flashdata('updated')):?>
					<div class="alert alert-info"><strong><?=$updated?></strong></div>
					<?php endif;?>
					<?php if($danger = $this->session->flashdata('danger')):?>
					<div class="alert alert-danger"><strong><?=$danger?></strong></div>
					<?php endif;?>
				</div>
				<div style="text-align:right">
					<strong>Trạng thái: </strong>
					<?=form_dropdown('status',$status,'-1','style="width:120px;"')?>
					<input type="submit" class="btn btn-success" value="Cập nhật"/>
				</div>			
				<table class="table table-striped table-bordered table-condensed ">
					<thead>
					  <tr>
						<th style="text-align:center" width="20px;">
							<input type="checkbox" onchange="check_all(this,event);"/>
						</th>
						<th class="header" width="45px;">STT</th>
						<th class="red header" width="120px;">Nick FB</th>
						<th class="red header">File name</th>						
						<th class="red header" width="120px;">Ngày upload</th>
						<th class="red header" width="120px;">Trạng thái</th>						
					</thead>
					<tbody>
					<?php $i = 1;					
						foreach($files as $obj):?>
						<tr>
							<td style="text-align:center" onclick="row_click(this,event);">
								<input type="checkbox" name="hoso[]" value="<?=$obj->id?>"/>
							</td>							
							<td style="text-align:right" onclick="row_click(this,event);"><?php echo $stt++;?></td>
							<td>
								<?=$obj->fb_nick?>
							</td>
							<td>
								<?=$obj->file_name?>
							</td>
							<td onclick="row_click(this,event);"><?=date('d/m/Y H:i:s', strtotime($obj->created))?></td>
							<td onclick="row_click(this,event);"><?=$status[$obj->status]?></td>
						</tr>
					<?php endforeach;?>      
					</tbody>
				</table>
			</form>
		 <?php echo '<div class="pagination">'.$this->pagination->create_links().'</div>'; ?>
	</div>
